import api from '../index'

export default {
  list: (data: any) => api.get(`/system/user/list`, {
    params: {
      username: data.username,
      nickName: data.nickName,
      phonenumber: data.phonenumber,
      pageSize: data.total,
      pageNum: data.page,
      schoolName: data.schoolName,
    },
  }),
  detail: (id: number | string) => api.get(`/system/user/getInfo`, {
    params: {
      userId: id,
    },
  }),
  create: (data: any) => api.post('/system/user/add', data, {
  }),
  resetPwd: (data: any) => api.post('/system/user/resetPwd', data, {
  }),
  changeStatus: (data: any) => api.post('/system/user/changeStatus', data, {
  }),
  edit: (data: any) => api.post('/system/user/edit', data, {
  }),

  delete: (id: number | string) => api.get(`/system/user/del`, {
    params: {
      userId: id,
    },
  }),
  uploadAvatar: (file: any) => api.post(`/common/uploadAvatar`, file, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  }),
  // uploadimagePhoto: (file: any) => api.post(`/common/uploadimagePhoto`, file, {
  //   headers: {
  //     'Content-Type': 'multipart/form-data',
  //   },
  // }),
  getSchoolList: () => api.get('/system/school/SchoolNamelist'), //  获取学校列表
  getRoleList: () => api.get('/system/role/rolelists'), //  获取角色列表
  getUserInfo: () => api.get('/getInfo'), //  获取登录角色

}
